package day03;

import com.sun.xml.internal.fastinfoset.algorithm.DoubleEncodingAlgorithm;

import java.util.Scanner;

public class Practise {
    public static void main(String[] args) {
        //取模
        System.out.println(6%3);//0
        System.out.println(15%34);//5
        System.out.println(19%4);//13
        /*
        自增·自减
        int a=10,b=15,c=10;
         a++;//11相当于a=a+1;
         --b;//14相当于b=b-1;
         c++;//11相当于c=c+1;
         System.out.println(a);//11
         System.out.println(b);//14
         System.out.println(c);//11
        被使用-----自增，自减
        */
        /* int a= 7,b=1,c=5;
        boolean a1=c>a;
        System.out.println(a1);//false
        System.out.println(a>b);//true
        System.out.println(a>=b);//true
        System.out.println(b<=c);//true
        System.out.println(b+c<a);//true
        System.out.println(c!=a);//true
        System.out.println(a+b>5);//true
        System.out.println(a%3==1);//true
        System.out.println(a++>8);//false
        System.out.println(a++>=8);//true*/
        /*int a=5,b=10,c=5;
        //演示&& ||  !
        System.out.println(a>b && a==c);//false
        System.out.println(a!=c&&a+c==b);//false
        System.out.println(a==c||a>b);//true
        System.out.println(a+c>=b||a<c);//true*/
       /* int a=4;
        a+=46;
        System.out.println(a);//50
        a*=4;
        System.out.println(a);//200
        a/=30;
        System.out.println(a);//6*/
        /*String name="哈利波特";
        System.out.println("大家好，我的名字叫"+name+".");
        //演示同化作用
        System.out.println(10+150+20+""+0);//1800
        System.out.println(""+51+0+1);//5101
        System.out.println(50+20+44+"");//114*/
        //条件运算符
      /*  int a=55,b=987;
        int max=a>b?a:b;
        System.out.println(max);*/
        //分支结构
        //满2000打5折，1000打6折，500打·7折，不满500打9折
       /* double price=2000;
        if (price>=2000){
            price*=0.5;
        }else if (price>=1000){
            price*=0.6;
        }else if (price>=500){
            price*=0.7;
        }else {
            price*=0.9;
        }
        System.out.println("最终消费金额为："+price+"元。");*/
        //扩展练习
        // int a=10,b=15;
        // int max;
        //int max=a>b?a:b;
        //System.out.println(max);//15
        //判断闰平年
        int year=2024;
        if ((year/4==0&&year/100!=0)||year/400==0){
            System.out.println(year+"是闰年");
        }else {
            System.out.println(year + "是平年");
        }
        //成绩大于等于90，大于等于80且小于90，大于等于60且小于80，小于60\
        int score=85;
        if (score>100||score<0){
            System.out.println("成绩不合法");
        }else if (score>=90){
            System.out.println("成绩优秀");
        }else if (score>=80){
            System.out.println("成绩良好");
        }else if (score>=60){
            System.out.println("成绩及格");
        }else{
            System.out.println("成绩不及格");
        }
        System.out.println("2");

    }
}
